

function addSensorbitCod(Blockly) {




    //灰度传感器模块
    Blockly.Python.microbit_grayscale = function(block) {
        var dropdown_grayscale = this.getFieldValue('grayscale');
        Blockly.Python.definitions_['import_microbit'] = 'from microbit import *';
        Blockly.Python.definitions_['import_Grayscale'] = 'from sensor import grayscale';
        var code = "grayscale.get_value("+ dropdown_grayscale +")";
        return [code];
      }

    return Blockly;
}

module.exports = addSensorbitCod;

